In an electronic control unit (ECU) for controlling an engine of automobile, a plurality of microcomputers is used. In such an ECU, a plurality of microcomputers executes processes for controlling objects assigned thereto while sending and receiving calculated control data through communication (microcomputer communication).
In the ECU of this type, each microcomputer transfers each data of every kind to be transmitted to the other microcomputers to its transmitting buffer in the predetermined sequence whenever it becomes the transmission timing of data. Here, a practical example is illustrated in FIGS. 8A and 8B. In this example, a main microcomputer and a sub-microcomputer respectively make two-way communications.
In the example of FIG. 8A, the main microcomputer transmits to the sub-microcomputer various data including number of engine rotations, amount of intake air, ON/OFF state of brake switch, ON/OFF state of IG (Ignition) switch, and the like.
Transmission sequence of all data is previously determined as follows. For example, the first data to be transmitted to the sub-microcomputer from the main microcomputer is the number of rotations, the second data is the amount of intake air and the third data is ON/OFF state of brake switch. The main microcomputer transfers all data to be transmitted to the sub-microcomputer to its transmitting buffer (TB) in the sequence described above whenever it becomes the transmission timing, and then transmits these data to the sub-microcomputer.
Therefore, a receiving buffer (RB) of the sub-microcomputer stores respective data in the sequence in which the data is transferred from the main microcomputer. Accordingly, the sub-microcomputer in the receiving side can identify the data from the sequence of data stored in the receiving buffer.
In the example of FIG. 8B, various data such as accelerator position, throttle position, vehicle speed and the like are transmitted from the sub-microcomputer. In regard to the data to be transmitted to the main microcomputer from the sub-microcomputer, transmission sequence of every data is also determined such that the first data is the accelerator position, second data is the throttle position, etc. The sub-microcomputer, whenever it becomes the transmission timing, transmits all data to be transmitted to the main microcomputer to its transmitting buffer (TB) in the sequence described above, and then transmits these data to the main microcomputer.
Therefore, these data are stored in a receiving buffer (RB) of the main microcomputer in the sequence in which the sub-microcomputer transmits the data. From the sequence in which data are stored in the receiving buffer, the main microcomputer as a receiving side can identify the data.
However, the above data transmission method is designed to perform transmission of all data that is to be transmitted every time it becomes the transmission timing. In a apparatus where communication is performed in every 8 ms, even data to be updated in every 32 ms has also been transmitted in every 8 ms. This means that the data to be transmitted in a longer transmission period, that is to say, data having the longer update period, are also transmitted in the same period as the data having the shorter update period. Accordingly, the method suffers from unnecessary period, confronting with difficulty in increasing the number of data to be transmitted.
To cope with this problem, a method is considered that permits data transmission corresponding to various transmission timings by providing plural transmission timings therein. Specifically, assuming the apparatus in which communication is performed in every 8 ms, the data updated in every 32 ms is transmitted once in every four transmission timings having an interval of 8 ms (that is, in the transmission timing of every 32 ms).
This transmission method is considered to need a program that controls all data to be transmitted with respect to which data should be transmitted and at which timing it should be transmitted. However, this method results in complication of data transmission process. Moreover, it is difficult to execute readily addition, deletion of data as the transmission object, and change of transmission timing.
Specifically, in this case, its process is as follows: the current transmission timing is determined among a plurality of timings such as 8 ms and 32 ms from the routine which is determined at the transmission timing and thereby the data to be transmitted in the determined transmission timing to the transmitting buffer by reading this data from a memory area thereof.
However, assuming that data d which has been transmitted at the transmission timing a is requested to be transmitted in another transmission timing b, a processing part that reads data d and transfers the data to the transmitting buffer needs to be deleted from the contents of the program which is executed when this transmission timing is determined as the transmission timing a. Then another processing part that reads data d and transfers the data to the transmitting buffer needs to be added into the contents of the program which is executed when this transmission timing is determined as the transmission timing b. Thus, the program must be revised in many parts and points.
Therefore, an object of the present invention is to easily simplify a process for data transmission and to easily realize addition, deletion of data as the transmission object and change of transmission timing.
A data transmission apparatus according to the present invention transfers, at transmission timing, data to be transmitted in this transmission timing among a plurality of data to a transmitting buffer, and then transmits the data stored in this transmitting buffer to other apparatuses. This transmission apparatus is provided with a plurality of data buffers, for a plurality of transmission timings, to which data to be transmitted in such transmission timings are stored. Moreover, in this transmission apparatus, a data buffer in which the data to be transmitted in the inputted transmission timing is stored is identified from the data buffers for the transmission timings and the data stored in the identified data buffer is then transmitted to the transmitting buffer.
This transmission apparatus provides the following advantages.
(1) Addition and deletion of data as the transmission object and change of transmission timing can be realized only by changing contents of data buffers provided for respective transmission timings (which data shall be stored to which data buffer). Particularly, when transmission timing of a certain data d is requested to be changed, such request can be satisfied only by changing destination of write operation of data d in the manner that the calculation program for obtaining data d writes such data d to the data buffer corresponding to the transmission timing b after the above change in place of the data buffer corresponding to the transmission timing a before the above change.(2) Data transmission process can be simplified because the data as transmission object is processed in unit of data buffer. Namely, each data as the transmission object is not required to be checked individually whether it is transmitted in the present transmission timing or not and since such transmission object data can be processed simultaneously for every data buffer, the data transmission can be processed effectively.(3) Since only the data to be transmitted in each transmission timing is transmitted, transmission efficiency is high and the number of data to be transmitted can be increased easily.
In an electronic control unit of the present invention, a plurality of microcomputers executes the process to control the control object while data communication is performed. Particularly the microcomputers in the transmitting side to transmit data among a plurality of microcomputers are respectively provided with data buffers storing data to be transmitted for the specified transmission timing of a plurality of transmission timings. Moreover, the microcomputers in the transmitting side identifies, at every transmission timing, the data buffer storing the data to be transmitted at the transmission timing among the data buffers for respective transmission timings and transmits the data in the identified data buffer to the other microcomputers.
In the case of the electronic control unit wherein data can be transmitted from each one of a plurality of microcomputers, it is effective to apply the configuration of microcomputers in the transmitting side for all microcomputers, but it is also possible to apply the configuration of microcomputers in the transmitting side only to a part of the microcomputers.